//
//  UIBarButtonItem+Entension.swift
//  weibo
//
//  Created by 吴婷婷 on 15/11/16.
//  Copyright © 2015年 wutingting. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    convenience init(imageName: String, actionName: String?, target: AnyObject?) {
        let button = UIButton(imageName: imageName, backImageName: nil)
        //判断是否选择表情按钮
        if let actionName = actionName {
            button.addTarget(target, action: Selector(actionName), forControlEvents: .TouchUpInside)
        }
        self.init(customView: button)
    }
}
